package com.ssy.lingxi.logistics.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 发货地址实体类
 *
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/13
 */
@Data
@Entity
@Table(schema = "public", name = "ls_logistics_shipper_address",
        indexes = {@Index(name = "ls_logistics_shipper_address_member_id_idx", columnList = "memberId"),
        @Index(name = "ls_logistics_shipper_address_role_id_idx", columnList = "roleId")})
public class ShipperAddress implements Serializable {

    private static final long serialVersionUID = -1689612163713855542L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "logistics_shipper_address_seq")
    @SequenceGenerator(sequenceName = "ls_logistics_shipper_address_seq", name = "logistics_shipper_address_seq", allocationSize = 1)
    private Long id;

    /**
     * 发货人名称
     */
    @Column(columnDefinition = "varchar(40)")
    private String shipperName;

    /**
     * 省编号
     */
    @Column
    private String provinceCode;

    /**
     * 省名称
     */
    @Column
    private String provinceName;

    /**
     * 市编号
     */
    @Column
    private String cityCode;

    /**
     * 市名称
     */
    @Column
    private String cityName;

    /**
     * 区编号
     */
    @Column
    private String districtCode;

    /**
     * 区名称
     */
    @Column
    private String districtName;

    /**
     * 街道编码
     */
    @Column(columnDefinition = "varchar(10)")
    private String streetCode;

    /**
     * 街道名称
     */
    @Column(columnDefinition = "varchar(20)")
    private String streetName;

    /**
     * 详细地址
     */
    @Column(columnDefinition = "varchar(60)")
    private String address;

    /**
     * 邮编
     */
    @Column(columnDefinition = "varchar(16)")
    private String postalCode;

    /**
     * 手机区号
     */
    @Column(columnDefinition = "varchar(16)")
    private String areaCode;

    /**
     * 手机号码
     */
    @Column(columnDefinition = "varchar(20)")
    private String phone;

    /**
     * 电话号码
     */
    @Column(columnDefinition = "varchar(20)")
    private String tel;

    /**
     * 所属门店名称
     */
    @Column(columnDefinition = "varchar(20)")
    private String storeName;

    /**
     * 是否默认 0-否 1-是
     */
    @Column
    private Integer isDefault;

    /**
     * 是否门店地址 0-否 1-是
     */
    @Column
    private Integer isStore;

    /**
     * 数据关联会员id
     */
    @Column
    private Long memberId;

    /**
     * 数据关联角色id
     */
    @Column
    private Long roleId;

    /**
     * 数据关联门店ID (系统能力-门店管理 用于同步地址数据)
     */
    @Column
    private Long storeId;

    /**
     * 门店地址状态 0-否 1-是
     */
    @Column
    private Integer storeStatus;

    /**
     * 创建时间
     */
    @Column
    private Long createTime;
}
